﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wfBindBalanceInfo.aspx.cs" Inherits="msBsc.WebUi.wMall.Buyer.wfBindBalanceInfo" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/themes/wStyle1/css/sLayout.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/sHead.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/sFoot.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/Seller/sDjackInfo.css" rel="stylesheet" />
    <link href="/themes/wStyle1/css/Buyer/sTouristInfo.css" rel="stylesheet" />

    <link href="/themes/wStyle1/css/usermenu.css" rel="stylesheet" />
    <title>账户绑定</title>
    <style>
        input[type=text], #selBankList {
            border: 0;
            border: 1px solid #808080;
            width: 300px;
            height: 30px;
            line-height: 30px;
        }

            input[type=text]:hover {
                border: 1px solid #0094ff;
            }

        input[type=button] {
            width: 80px;
            height: 28px;
            text-align: center;
            line-height: 28px;
            border: 0;
            background-color: #7abd54;
            color: #fff;
            font-size: 14px;
            font-family: 微软雅黑;
            cursor: pointer;
        }

            input[type=button]:hover {
                opacity: 0.8;
            }

        .bind-notice-msg {
            width: 770px;
            padding: 10px 15px;
            border: 1px solid #f60;
            font-family: 微软雅黑;
            font-size: 16px;
            color: #0094ff;
            margin-bottom: 20px;
            text-indent: 32px;
        }

        .content-wrap {
            width: 100%;
            padding: 20px;
        }

            .content-wrap span {
                display: table-cell;
                padding-right: 15px;
            }

        .content-row {
            line-height: 45px;
        }

        .bindBank-title, .bindAlipay-title {
            width: 780px;
            height: 35px;
            line-height: 35px;
            font-family: 微软雅黑;
            font-size: 18px;
            color: #fff;
            background-color: #0094ff;
            padding-left: 20px;
        }

        .bindBank-content, .bindAlipay-content {
            width: 798px;
            border: 1px solid #808080;
        }

        .bindAlipayInfo {
            margin-top: 15px;
        }

        .notice-title {
            width: 120px;
            text-align: right;
            font-family: 微软雅黑;
            font-size: 14px;
            color: #808080;
            letter-spacing: 3px;
        }

        .notice-msg {
            font-size: 12px;
            font-family: 微软雅黑;
            color: #f00;
        }

        .btnReset {
            background-color: #0094ff !important;
        }

        .ErrBorder {
            border-color: #f00 !important;
        }
    </style>
</head>
<body>
    <div class="wf_all">
        <input type="hidden" id="hidIsModifyBank" value="N" />
        <input type="hidden" id="hidIsModifyAlipay" value="N" />
        <div id="divLoginInfo">
            <%=msBsc.WebUi.Code.QtHtmlGet.GetHeaderLoginInfo() %>
        </div>
        <div class="main-container">
            <div class="tourist-content">
                <div class="sidebar-scroll noborder">
                    <%=msBsc.WebUi.Code.QtHtmlGet.GetTouristMenuHtml() %>
                </div>
                <div class="main-Info">
                    <div class="tnavigation">
                        <a href="#" class="nav">账户中心</a>&gt;
			
                        <a href="#" class="nav-on">账户绑定</a>
                    </div>
                    <hr />
                    <div class="content-wrap">
                        <div class="bind-notice-msg">
                            绑定<%--银行及--%>支付宝账号后，可更加方便的进行提现操作！填写账号信息时，请务必确认后进行提交，以免因操作失误，而造成不必要的损失！
                        </div>

                        <%--<div class="bindBankInfo">
                            <div class="bindBank-title">绑定银行账户</div>
                            <div class="bindBank-content">
                                <div class="content-row">
                                    <span class="notice-title">开户行:</span>
                                    <span class="cust-input">
                                        <select id="selBankList">
                                        </select>
                                    </span>
                                    <xmp id="bank_name_list" style="display: none">
                                    <option value="0">请选择银行账户开户行</option>
            {{#for(var i=0,len=d.rows.length;i < len;i++){ }}
                   <option value="{{d.rows[i].BANK_ID}}">{{d.rows[i].BANK_NME}}</option>
            {{#} }}
            </xmp>
                                    <span class="notice-msg notice-msg-bank"></span>
                                </div>

                                <div class="content-row">
                                    <span class="notice-title">用户名:</span>
                                    <span class="cust-input">
                                        <input type="text" id="txtBankUserNme" value="" placeholder="请输入银行账户用户名" />
                                    </span>
                                    <span class="notice-msg notice-msg-username"></span>
                                </div>

                                <div class="content-row">
                                    <span class="notice-title">银行账户:</span>
                                    <span class="cust-input">
                                        <input type="text" id="txtBankAccount" value="" placeholder="请输入银行账户" />
                                    </span>
                                    <span class="notice-msg notice-msg-bankaccount"></span>
                                </div>

                                <div class="content-row">
                                    <span class="notice-title">银行名称:</span>
                                    <span class="cust-input">
                                        <input type="text" id="txtBankComNme" value="" placeholder="请输入开户行全称" />
                                    </span>
                                    <span class="notice-msg notice-msg-comnme"></span>
                                </div>

                                <div class="content-row">
                                    <span class="notice-title"></span>
                                    <span class="cust-input">
                                        <input type="button" id="submitBank" value="确认绑定" />
                                        <input type="button" class="btnReset" id="resetBank" value="清空内容" />
                                    </span>
                                </div>
                            </div>
                        </div>--%>

                        <div class="bindAlipayInfo">
                            <div class="bindAlipay-title">绑定支付宝账户</div>
                            <div class="bindAlipay-content">
                                <div class="content-row">
                                    <span class="notice-title">支付宝账号:</span>
                                    <span class="cust-input">
                                        <input type="text" id="txtAlipayAccount" value="" placeholder="请输入支付宝账号" />
                                    </span>
                                    <span class="notice-msg notice-msg-aliaccount"></span>
                                </div>
                                <div class="content-row">
                                    <span class="notice-title">验证账号:</span>
                                    <span class="cust-input">
                                        <input type="text" id="txtConfirmAccount" value="" placeholder="请再次输入支付宝账号" />
                                    </span>
                                    <span class="notice-msg notice-msg-confirm"></span>
                                </div>
                                <div class="content-row">
                                    <span class="notice-title"></span>
                                    <span class="cust-input">
                                        <input type="button" id="submitAplipay" value="确认绑定" />
                                        <input type="button" class="btnReset" id="resetAlipay" value="清空内容" />
                                    </span>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>


        <!--start JS引用-->
        <script src="/jqPlugin/js/jquery-1.8.3.min.js"></script>
        <script src="/jqPlugin/js/jBase.js"></script>
        <script src="/jqPlugin/js/jBPage.js"></script>
        <script src="/jqPlugin/js/laytpl.js"></script>
        <script src="/themes/wStyle1/js/comm/VerifyJs.js"></script>

        <script src="/jqPlugin/SelectSimu/js/SelectSimu.js"></script>
        <script src="/themes/wStyle1/js/comm/jsLayout.js"></script>
        <!--end JS引用-->
        <script type="text/javascript">
            function ResetBindInfo() {
                $("#resetBank").click(function () {
                    $("#selBankList").val("0");
                    $("#txtBankUserNme").val("");
                    $("#txtBankAccount").val("");
                    $("#txtBankComNme").val("");
                    $("select").change()
                    $("input[type=text]").keyup()
                })

                $("#resetAlipay").click(function () {
                    $("#txtAlipayAccount").val("");
                    ShowSuccessMsg("txtAlipayAccount", "notice-msg-aliaccount")
                })
            }
            ResetBindInfo();

            $(function () {
                $("#submitBank").click(function () {
                    BindBankInfo();
                })

                $("#submitAplipay").click(function () {
                    BindAlipayInfo();
                })

                $("select").change(function () {
                    ShowSuccessMsg($(this).attr("id"), "notice-msg")
                })

                $("input[type=text]").keyup(function () {
                    ShowSuccessMsg($(this).attr("id"), "notice-msg")
                })
            })

            function InitBankInfo(bankId, busername, baccount, bcomnme) {
                $("#selBankList").val(bankId);
                $("#txtBankUserNme").val(busername);
                $("#txtBankAccount").val(baccount);
                $("#txtBankComNme").val(bcomnme);
                $("#submitBank").val("确认修改");
                $("#hidIsModifyBank").val("Y");
            }

            function InitAliPayInfo(aliPayAccount) {
                $("#txtAlipayAccount").val(aliPayAccount).attr("disabled", "disabled");
                //$("#submitAplipay").val("确认修改");
                $("#submitAplipay").attr("disabled", "disabled");
                $("#resetAlipay").attr("disabled", "disabled");
                $("#hidIsModifyAlipay").val("Y");
            }

            function BindBankInfo() {
                $("#submitBank").attr("disabled", "disabled");
                $("#submitBank").val("正在绑定...");

                var bankId = $("#selBankList").val();
                if (bankId == "0") {
                    ShowErrMsg("selBankList", "notice-msg-bank", "请选择银行账户开户行");
                    return;
                }
                var busername = $("#txtBankUserNme").val();
                if (IsNull(busername)) {
                    ShowErrMsg("txtBankUserNme", "notice-msg-username", "银行账户用户名不能为空");
                    return;
                }
                var baccount = $("#txtBankAccount").val();
                if (IsNull(baccount)) {
                    ShowErrMsg("txtBankAccount", "notice-msg-bankaccount", "银行账户不能为空");
                    return;
                }
                var bcomnme = $("#txtBankComNme").val();
                if (IsNull(bcomnme)) {
                    ShowErrMsg("txtBankComNme", "notice-msg-comnme", "开户行全称不能为空");
                    return;
                }

                var oparm = new jsonRow();
                oparm.AddCell("ACTION", "BindBankInfo");
                oparm.AddCell("bankId", bankId);
                oparm.AddCell("busername", busername);
                oparm.AddCell("baccount", baccount);
                oparm.AddCell("bcomnme", bcomnme);
                oparm.AddCell("IsModifyBank", $("#hidIsModifyBank").val());
                ajaxComm(oparm, null, function () {
                    $("#submitBank").val("确认绑定");
                    $("#submitBank").removeAttr("disabled");
                });
            }

            function BindAlipayInfo() {
                $("#submitAplipay").attr("disabled", "disabled");
                $("#submitAplipay").val("正在绑定...");
                var alipayAccount = $.trim($("#txtAlipayAccount").val());
                var comfirmAccount = $.trim($("#txtConfirmAccount").val());

                if (IsNull(alipayAccount)) {
                    ShowErrMsg("txtAlipayAccount", "notice-msg-aliaccount", "支付宝账号不能为空");
                    return;
                }

                if (IsNull(comfirmAccount)) {
                    ShowErrMsg("txtConfirmAccount", "notice-msg-confirm", "确认账号不能为空");
                    return;
                }

                if (alipayAccount != comfirmAccount) {
                    ShowErrMsg("txtConfirmAccount", "notice-msg-confirm", "支付宝账号与确认账号不一致");
                    return;
                }

                var oparm = new jsonRow();
                oparm.AddCell("ACTION", "BindAlipayInfo");
                oparm.AddCell("alipayAccount", alipayAccount);
                oparm.AddCell("IsModifyAlipay", $("#hidIsModifyAlipay").val());
                ajaxComm(oparm, null, function () {
                    $("#submitAplipay").val("确认绑定");
                    $("#submitAplipay").removeAttr("disabled");
                });
            }

            function ShowErrMsg(ErrSourceId, MsgClass, MsgStr) {
                $("#" + ErrSourceId).addClass("ErrBorder")
                $("." + MsgClass).text("*" + MsgStr)
                $("#submitBank").val("确认绑定");
                $("#submitBank").removeAttr("disabled");
                $("#submitAplipay").val("确认绑定");
                $("#submitAplipay").removeAttr("disabled");
            }

            function ShowSuccessMsg(SuccessSourceId, MsgClass) {
                $("." + MsgClass).text("")
                $("#" + SuccessSourceId).removeClass("ErrBorder")

            }
        </script>

        <%=msBsc.WebUi.Code.QtHtmlGet.GetFloorHtml() %>
    </div>
</body>
</html>
